Skip to content

Conversation

@alexandrujircan
Copy link
Collaborator

add support for classification

@github-actions github-actions bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-llamaindex Triggers tests in the uipath-llamaindex-python repository labels Oct 16, 2025
@alexandrujircan alexandrujircan changed the base branch from main to feat/documents/add-support-for-digitization October 16, 2025 09:39
Comment on lines +67 to +88
_are_mutually_exclusive(file=file, file_path=file_path)

if _is_provided(project_name):
_must_be_provided(project_type=project_type)
_must_not_be_provided(digitization_result=digitization_result)
else:
_must_not_be_provided(project_type=project_type)
_must_not_be_provided(file=file, file_path=file_path)
if _is_provided(digitization_result):
project_type = digitization_result.project_type
else:
_must_be_provided(classification_result=classification_result)
_must_not_be_provided(document_type_name=document_type_name)
project_type = ProjectType.MODERN

if _is_not_provided(classification_result):
if project_type == ProjectType.MODERN:
_must_be_provided(document_type_name=document_type_name)
else:
_must_not_be_provided(document_type_name=document_type_name)

return project_type
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Painful to read through this. We really need to split into more granular functionalities per project type. But leaving that aside, isn't it missing some cases that are invalid? e.g. passing digitization with an IXP project and also a classification result.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I refined these checks in a later PR, so I also need to update them here. But as you said, there are lots of conditions and branches, it's even worse trying to describe them in words, like in docstrings

project_id: str = Field(alias="ProjectId")


class ClassificationResponse(BaseModel):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not used. I guess the purpose of this class was to be used as response type for the classify method, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I forgot to delete it. At first, I thought about returning the entire response, but I think it’s more intuitive to just return a list of classification results, to keep it consistent with the other functions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-llamaindex Triggers tests in the uipath-llamaindex-python repository

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants